﻿///
/// Pamela.Logic.Layers.Base
///
namespace Pamela.Logic.Layers.Base
{
    using System;
    using System.Collections.Generic;

    using Pamela.Logic.Imps;
    using Pamela.Logic.Imps.Base;
    using Pamela.Logic.Helpers;
    using Pamela.Logic.ProjectFiles.Base;

    public abstract class BaseLayer
    {
        /// <summary>
        /// The collection of builder objects
        /// </summary>
        protected List<BaseBuilder> builderCollection;

        /// <summary>
        /// The name identifying the layer object
        /// </summary>
        protected string layerName;

        /// <summary>
        /// The csproj file associated to this layer instance
        /// </summary>
        protected ProjectFileBase projectFile;
        public ProjectFileBase ProjectFile { get { return this.projectFile; } private set { } }

        /// <summary>
        /// Builder  object containing all the info to necessary perform the scaffolding operation
        /// </summary>
        protected BuilderInfo builderInfo;

        public BaseLayer(BuilderInfo info, string layerName)
        {
            this.builderCollection = new List<BaseBuilder>();
            this.builderInfo = info;
            this.layerName = layerName;
        }

        public void Build()
        {
            foreach (var builder in this.builderCollection)
            {
                builder.Build();
            }
        }
    }
}
